home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business Assistant
/
Business Assistant.iso
/
acctg
/
dbbills
/
edittask.prg
< prev
next >
Wrap
Text File
|
1986-11-11
|
4KB
|
148 lines
*--[ edittask.prg ]-- edit existing tasks
set deleted off
CLEAR
SELECT 1
USE client INDEX cltname,cltcode ALIAS clt
SELECT 2
USE taskunit INDEX taskdate ALIAS task
trash=""
DO WHILE .T.
CLEAR
SET COLOR TO W+
@ 1,29 SAY "EDIT EXISTING TASK DATA"
SET COLOR TO W
TEXT
===============================================================================
Tasks may be located by client and date. You may change any task for
the specified client and date. Leave CLIENT CODE blank to end the
editing process.
To delete a task record type "DELETE" and nothing else in Description
of Task.
ENDTEXT
mc_name=SPACE(35)
STORE DATE() TO m_taskdate,m_lastdate
@ 12,15 SAY "CLIENT " GET mc_name PICTURE "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
SET DATE AMERICAN
@ 14,15 SAY "DATE OF FIRST TASK RECORD " GET m_taskdate PICTURE "@D"
@ 15,15 SAY "DATE OF LAST TASK RECORD " GET m_lastdate PICTURE "@D"
SET COLOR TO W+
@ 20,15 SAY "Leave CLIENT empty to exit to the main menu."
SET COLOR TO W
READ
IF LEN(TRIM(mc_name))=0
EXIT
ENDIF LEN(TRIM(mc_name))=0
SELECT clt
SET ORDER TO 1
GO TOP && rewind to find a previous client
SEEK TRIM(mc_name)
IF .NOT. FOUND()
@ 22,15 SAY "UNABLE TO LOCATE "
SET COLOR TO W*+
@ 22,COL() SAY TRIM(mc_name)
SET COLOR TO W
@ 22,COL() SAY " IN CLIENT FILE "
WAIT " PRESS RETURN"
@ 3,0 CLEAR
LOOP
ENDIF .NOT. FOUND()
SET DATE ANSI
date_key=STR(clt->c_code,3,0)+DTOC(m_taskdate)
SELECT task
SEEK date_key
IF .NOT. FOUND()
@ 23,15 SAY "UNABLE TO LOCATE "
SET DATE AMERICAN
SET COLOR TO W*+
@ 23,COL() SAY m_taskdate
SET COLOR TO W
@ 23,COL() SAY " IN TASK FILE "
WAIT " PRESS RETURN"
@ 3,0 CLEAR
LOOP
ENDIF .NOT. FOUND()
SELECT clt
m_client=c_code
IF clipper
SET INDEX TO cltcode
ELSE
SET ORDER TO 2
ENDIF clipper
@ 3,0 CLEAR
SET COLOR TO W+
@ 3,0 SAY "CLT DATE BEGIN END DESCRIPTION OF TASK CH HOURS FEE BILLED"
SET COLOR TO W
line=4
STORE 0 TO m_cost,m_fee,fees
SELECT task
DO WHILE c_code=m_client .AND. taskdate>=m_taskdate .AND. taskdate<=m_lastdate && any LOOP command comes back to here
mc_code=c_code
@ line,0
@ line,0 GET mc_code PICTURE "###"
SET DATE AMERICAN
@ line,5 GET taskdate
SET DATE ANSI
@ line,15 GET start PICTURE "@R ##:##"
@ line,21 GET finish PICTURE "@R ##:##"
@ line,27 GET descriptn PICTURE "!XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
@ line,59 GET charge PICTURE "@L"
m_fee=hours*clt->rate
@ line,61 SAY STR(hours,4,1)
@ line,66 SAY STR(m_fee,6,2)
IF charge
@ line,73 SAY STR(m_fee,6,2)
ENDIF charge
READ
IF mc_code=0
EXIT
ELSE
IF mc_code<>c_code
REPLACE c_code WITH mc_code
ENDIF
ENDIF mc_code=0
IF UPPER(TRIM(descriptn))="DELETE"
DELETE
SET COLOR TO W*+
@ line,37 SAY " TASK IS DELETED "
SET COLOR TO W
ENDIF UPPER(TRIM(descriptn))="DELETE"
SELECT clt
SEEK m_client
IF .NOT. FOUND()
SET COLOR TO W*+
@ 22,15 SAY "CLIENT NOT VALID - TRY AGAIN"
SET COLOR TO W
WAIT " PRESS RETURN TO CONTINUE"
@ 22,0 CLEAR
m_client=0
SELECT task
LOOP
ENDIF .NOT. FOUND()
SELECT task
time_on=VAL(SUBSTR(start,1,2))+VAL(SUBSTR(start,3,2))/60
time_off=VAL(SUBSTR(finish,1,2))+VAL(SUBSTR(finish,3,2))/60
IF time_on>time_off
SET COLOR TO W*+
@ 23,15 SAY "INVALID ON AND OFF TIME - TRY AGAIN"
SET COLOR TO W
@ 23,0
LOOP
ENDIF
REPLACE hours WITH time_off-time_on
m_fee=hours*clt->rate
@ line,61 SAY STR(hours,4,1)
@ line,66 SAY STR(m_fee,6,2)
m_cost=m_cost+m_fee
IF charge
@ line,73 SAY STR(m_fee,6,2)
fees=fees+m_fee
ENDIF charge
line=line+1
line=IIF(line=21,4,line)
SKIP
ENDDO WHILE c_code=m_client .AND. taskdate>=m_taskdate .AND. taskdate<=m_lastdate&& paint next record
ENDDO WHILE .T.
RETURN